package com.jxaummd.mushroom.app;


import android.app.Application;

import com.blankj.utilcode.util.Utils;
import com.bumptech.glide.Glide;
import com.jxaummd.mushroom.app.activities.ActivityRegister;
import com.jxaummd.mushroom.core.app.application.University;


import org.litepal.LitePal;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Response;


public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        University.init(this)
                .withApiHost("http://47.107.183.2/")
                .withStsServer("http://47.107.183.2/")
                .withLoaderDelayed(1000)
                .withJavascriptInterface("university")
                .withThemeColor(0xff1E7485)
                .withInterceptor(new Interceptor() {
                    @Override
                    public Response intercept(Chain chain) throws IOException {
                        return chain.proceed(chain.request());
                    }
                })          //拦截器
//                .withAuthenticator(new Au)      //身份过期，自动刷新
                .withPublicOssUrl("http://public-university.oss-cn-shenzhen.aliyuncs.com/")
                .configure();

        Glide.with(this);
        Utils.init(this);
        LitePal.initialize(this);
        LitePal.getDatabase();
        //注册Activity
        ActivityRegister.init();
    }
}
